new Vue({
    el: '#content',
    data() {
        return {
            currentPage: 1, //初始页
            pagesize: 2,//初始页面大小
            number:0,
            tableData:[]
        }
    },
    computed: {

    },
    created() {

    },
    beforeDestroy() {

    },
    mounted() {
        this.show_page()
        this.getNumber()
    },
    methods: {
        //改变页面大小
        handleSizeChange(new_size) {
            this.pagesize = new_size;
            this.show_page()
        },
        //改变当前显示页
        handleCurrentChange(new_page) {
            this.currentPage = new_page;
            this.show_page()
        },
        //展示页面
        show_page() {
            var that = this
            let str = 'state=0&current='+that.currentPage+'&size='+that.pagesize
            axios.get('http://localhost:8083/authentication/selectPage?'+str)
                .then(response => {
                    console.log(response.data)
                    that.tableData = response.data.data
                })
                .catch(error => {
                    console.log(error)
                })
        },
        //获取总人数
        getNumber(){
            var that = this
            let str = 'state=0'
            axios.get('http://localhost:8083/authentication/getNumber?'+str)
                .then(response => {
                    console.log(response.data)
                    that.number = response.data.data
                })
                .catch(error => {
                    console.log(error)
                })
        },
        //审查，改变state值
        check(_state,_userId){
            // alert(_state)
            // alert(_userId)
            axios.put('http://localhost:8083/authentication/Examine',{
                state :_state,
                id : _userId
            }).then(ret=>{
                console.log(ret.data)
            })
        },
        computed: {},
    }})